<include file="Public:header" />
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__PUBLIC__/style/js/TableFreeze.js"></script>
<script src="__PUBLIC__/js/mxcrm_more.js" type="text/javascript"></script>
<style>
body{
	overflow-y: hidden;
}
.option{padding-left:-30px;}
</style>
<script>
$(function(){
	var scroll_width = 5;
	$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-parseInt($("#table_container").css("padding-bottom").replace("px",""))-10);
	$(window).resize(function(){
		$("#table_div").height(window.innerHeight-$("#table_div").offset().top-$("#tfoot_div").height()-parseInt($("#table_container").css("padding-bottom").replace("px",""))-10);
		$("#oDivL_tab_Test3").height($("#table_div").height()-scroll_width-1).width($("#oTableLH_tab_Test3").width());
		$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width()-scroll_width);
	})
	if ("{$Think.get.by}") {
		$("#filter_ul").prev().html($("#filter_ul>li>a.active").text()+'<span class="fa fa-angle-down small_fa"></span>');
	}
	$("#tab_Test3").FrozenTable(1,0,3);
	$("#oDivL_tab_Test3").height($("#table_div").height()-scroll_width).width($("#oTableLH_tab_Test3").width());
	$("#oDivH_tab_Test3").height($("#oTableLH_tab_Test3").height()).width($("#table_div").width()-scroll_width);
	//$("#oDivH_tab_Test3").css('top','-7px');
})
</script>
<div class="wrapper wrapper-content">
	<include file="Public:alert" />
    <div class="row">
        <div class="col-md-12">
            <div class="ibox float-e-margins">
				<div class="title-bar">
					<div class="row  clearfix" id="title-hide" style="display:none;">
						<ul class="breadcrum pull-left">
							<li>已选中&nbsp;<span id="icheck_num"></span>&nbsp;项</li>
							<li><a id="delete" href="javascript:void(0)"><i class="fa fa-times"></i>&nbsp;删除</a></li>
							<li class="last_li"><big><a class="fa fa-times pull-right" id="back-show"></a></big></li>
						</ul>
					</div>
					<div class="row " id="title-show">
						<!-- <ul class="nav pull-left" style="margin:2px 0 0 15px;">
							<a class="btn btn-primary btn-sm" href="{:U('announcement/add')}"><i class="fa fa-plus"></i>&nbsp; {:L('ADD THE ANNOUNCEMENT')}</a>
						</ul> -->
						<form class="form-inline" id="" action="" method="get">
						<ul class="breadcrum pull-right" style="margin-bottom: 0px">
							<li>
								搜索：
								<div class="input-group">
									<input type="hidden" name="m" value="setting"/>
									<input type="hidden" name="a" value="smsrecord"/>
									<input type="hidden" name="condition" value="contains"/>
									<input type="hidden" name="field" value="telephone"/>
									<input id="short_search" type="text" style="width:160px;" placeholder="请输入手机号" onkeydown='if(event.keyCode==13) {$("#short_search_btn").trigger("click");return false;}' class="form-control input-sm" name="search" <if condition = "$_GET['field'] eq 'name'">value="{$_GET['search']}"</if>/>
									<span class="input-group-btn">
										<button class="btn btn-default btn-search" id="short_search_btn" type="submit"><i class="fa fa-search"></i></button>
									</span>
								</div>
							</li>
						</ul>
						</form>
					</div>
				</div>
				<div class="row" style="margin: 0">
					<div class="ibox-content">
						<div class="ibox-content clearfix" id="table_container" style="padding:0px;border: none;">
							<form id="form1" action="" method="Post" style="position:relative;"> 
								<div id="table_div" class="full-height-scroll" style="left:0px;top:0px;">
								<if condition="$data eq null">
									<include file="Public:nodata" />
								<else/>
									<table class="table table-hover table-striped table_thead_fixed" id="tab_Test3" style="background:#fff;margin-bottom:0px;">
										<tr id="childNodes_num" class="tabTh">
											<th>
												<!-- <input class="check_all" id="check_all" type="checkbox" /> &nbsp; -->
												<div class="checkbox checkbox-primary">
													<input type="checkbox" class="check_all"/>
													<label for=""></label>
												</div>
											</th>
											<th> {:L('SEND_ROW_NAME')}</th>
											<th>短信数量</th>
											<th> {:L('RECEIVE_TELEPHONE')}</th>
											<th> {:L('SEND_CONTENT')}</th>
											<th> 
												<if condition="$_GET['asc_order'] == 'sendtime'">
													<a href="{:U('setting/smsrecord','desc_order=sendtime&'.$parameter)}">
														{:L('SEND_SENDTIME')}&nbsp;<span class="fa fa-caret-up"></span>
													</a>
												<elseif condition="$_GET['desc_order'] == 'sendtime'"/>
													<a href="{:U('setting/smsrecord','asc_order=sendtime&'.$parameter)}">
														{:L('SEND_SENDTIME')}&nbsp;<span class="fa fa-caret-down"></span>
													</a>
												<else/>
													<a href="{:U('setting/smsrecord','desc_order=sendtime&'.$parameter)}">{:L('SEND_SENDTIME')}</a>
												</if>
											</th>
										</tr>
										<volist name="data" id="vo">
											<tr>
												<td>
													<!-- <input type="checkbox" class="check_list" name="record_id[]" value="{$vo.sms_record_id}"/> &nbsp; -->
													<div class="checkbox checkbox-primary">
														<input name="record_id[]" class="check_list" type="checkbox" value="{$vo.sms_record_id}"/>
														<label for=""></label>
													</div>
												</td>
												<td>
												   {$vo.role_name}
												</td>
												<td>{$vo.phone_counts}</td>
												<td title="{$vo.telephone}">
												   {$vo.subtelephone}
												</td>
												<td>
													<div title="{$vo.content}">{$vo.subcontent}</div>
												</td>
												<td>
													{$vo.sendtime|date='Y-m-d H:i:s',###}
												</td>
											</tr>
										</volist>
									</table>
								</if>
								</div>
								<div id="tfoot_div" class="clearfix">
									<tr>
										<div class="clearfix" id="tfoot_page">				
											{$page}<include file="Public:listrows" />
										</div>
									</tr>
								</div>
							</form>
						</div>
					</div>
				</div>
    		</div>
        </div>
    </div>
</div>
<script type="text/javascript">
	
	$('#delete').click(function(){
		var id_array = new Array();
		$("input.check_list:checked").each(function(){  
			id_array.push($(this).val());
		});
		if(id_array.length == 0){
			alert_crm('您没有选中任何短信记录！');
			return false;
		}
		swal({
			title: "您确定要删除短信记录吗？",
   			text: "删除后将无法恢复，请谨慎操作！",
			type: "warning",   
			showCancelButton: true,   
			confirmButtonColor: "#DD6B55",   
			confirmButtonText: "是的，我要删除！",
	        cancelButtonText:'让我再考虑一下…',
	        closeOnConfirm:false,
	        closeOnCancel:false
		},
		function(isConfirm){
	        if (isConfirm) {
	        	$.ajax({
		            type:'post',
		            url: "{:U('Setting/smsdelete')}",
		            data: {record_id: id_array},
		            async: false,
		            success: function (data) {
						if (data.status == 1) {
							swal("删除成功！", "您已经永久删除了信息！", "success");
							location.reload();
						}else{
							swal({
								title: "操作失败！",
								text:data.info,
								type: "error"
							})
							return false;
						}
		            },
		            dataType: 'json'
		        });
	        } else {
	            swal("已取消","您取消了删除操作！","error");
	        }
	    });
	});
	$("#dosearch").click(function(){
		result = checkSearchForm();
		if(result){
			$("#act").val('search');$("#searchForm").submit();
		} 
	});
</script>
<include file="Public:footer" />	